<template>
	<view class="app-container">
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<u-navbar slot="top" title="我的收藏" :autoBack="true" leftIconColor="#fff" placeholder bgColor="#cf141a" :titleStyle="{ color: '#fff' }"></u-navbar>
			<view class="goods-list">
				<view class="list-item" v-for="(item, index) in dataList" :key="index" @click="$toPath.goPage('pages/listings/details', { id: item.id })">
					<view class="list-info flex">
						<u--image :showLoading="true" :src="item.img" width="246rpx" height="188rpx"></u--image>
						<view class="info">
							<u--text :text="item.title" :lines="2" block color="#000000" size="28rpx"></u--text>
							<view class="label flex">
								<u--text :text="item.square" block align="left" color="#717171" size="28rpx"></u--text>
								<u--text :text="item.structure" block align="left" color="#717171" size="28rpx"></u--text>
							</view>
							<view class="price-item flex">
								<view class="item flex">
									<u--text text="起拍价" block align="left" color="#6e6e6e" size="24rpx"></u--text>
									<u--text :text="item.start_price" block align="left" color="#cf141a" size="28rpx" margin="0 10rpx 0"></u--text>
								</view>
								<view class="item flex">
									<u--text text="评估价" block align="left" color="#6e6e6e" size="24rpx"></u--text>
									<u--text :text="item.evaluate_price" block align="left" color="#cf141a" size="28rpx" margin="0 10rpx 0"></u--text>
								</view>
							</view>
						</view>
					</view>
					<view class="list-mode flex flex-between flex-align-center">
						<view class="count-item flex">
							<block v-if="item.status === '1' || item.status === '0'">
								<u--text :text="item.status === '0' ? '开拍时间：' : '结束时间：'" block align="left" color="#606060" size="26rpx"></u--text>
								<liu-countdown ref="countdown" :showSeconds="true" mode="2" :endDate="item.countdown_time" :auto="true"></liu-countdown>
							</block>
						</view>
						<view class="status flex flex-align-center flex-justify-center" :class="item.status === '1' ? 'error' : item.status === '0' ? 'succeed' : 'finish'">
							{{ item.status === '1' ? '正在拍卖' : item.status === '0' ? '即将开拍' : '拍卖结束' }}
						</view>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
export default {
	data() {
		return {
			dataList: []
		};
	},
	onLoad() {},
	methods: {
		queryList(pageNo) {
			this.$api
				.apiHouseCollectList({
					page: pageNo,
					uid: uni.getStorageSync('uid')
				})
				.then((res) => {
					this.$refs.paging.complete(res.house_list);
				});
		}
	}
};
</script>

<style></style>
